<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@page import="java.text.SimpleDateFormat" %>
<%@ page language="java" import="java.util.*" %>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>

<%
    String path = request.getContextPath();
%>
<%
    String d = request.getParameter("d");
    if (d != null && d.equals("1")) {
        response.setHeader("Content-disposition", "attachment; filename=daochu.xls");
    }
//获取并判断浏览器信息
    String Agent = request.getHeader("User-Agent");
    if (Agent.contains("Chrome")) {
        System.out.println("Chrome");
        request.setAttribute("brtype", "cbr");
    } else {
        System.out.println("!Chrome");
        request.setAttribute("brtype", "obr");
    }
    System.out.println(Agent);
%>


<html>
<head>
    <title>title</title>
    <!--bixanjxiqxi-->
    <LINK href="qtimages/style.css" type=text/css rel=stylesheet>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">




	<script type="text/javascript" src="<%=path %>/js/popup.js"></script>
	<script language="JavaScript" src="<%=path %>/js/public.js" type="text/javascript"></script>
	<script type='text/javascript' src='<%=path %>/dwr/interface/loginService.js'></script>
	<script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
	<script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
	<%--<script type="text/javascript" src="<%=path %>/My97DatePicker/WdatePicker.js"></script>--%>
	<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>
	<%--<script type="text/javascript" src="<%=path %>/js/riqi.js"></script>--%>

    <%--1 请先登录判断--%>
    
    <script>
        <c:if test="${sessionScope.user==null}">
        javascript:alert('对不起，请您先登陆！');history.back();
        </c:if>
    </script>


	<script language="javascript">
		//计算两个日期的天数差
		function dateDiff(){

			if(document.getElementById("kaishiriqi").value=="")
			{
				alert("please input:起始日期");
				return false;
			}

			if(document.getElementById("jieshuriqi").value=="")
			{
				alert("please input:结束日期");
				return false;
			}
			var firstriqi = document.getElementById("kaishiriqi").value;
			var secondriqi = document.getElementById("jieshuriqi").value;
			var first = new Date(firstriqi);
			var second = new Date(secondriqi);
			var diff = Math.abs(first.getTime() - second.getTime())
			var result = parseInt(diff / (1000 * 60 * 60 * 24));
			//document.getElementById("jine").value = result*${requestScope.kefang.jiage };
		}
		//导出信息
		function daochu()
		{
			var url="<%=path %>/chanpinpingjiaAll.action?d=1";
			window.location.href=url;
		}
		//上传文件
		function up()
		{
			var pop=new Popup({ contentType:1,isReloadOnClose:false,width:400,height:200});
			pop.setContent("contentUrl","<%=path %>/upload/upload.jsp");
			pop.setContent("title","文件上传");
			pop.build();
			pop.show();
			//另一红上传方式可以参照upx
		}
		//添加信息
		function chanpinpingjiaAddQian()
		{
			<c:if test="${sessionScope.user==null}">
			alert("请先登录");
			</c:if>
			<c:if test="${sessionScope.user!=null}">
			var url="<%=path %>/qiantai/chanpinpingjia/chanpinpingjiaAddQian.jsp";
			window.location.href=url;
			</c:if>
		}
		//删除信息
		function chanpinpingjiaDel(id)
		{
			if(confirm('您确定删除吗?'))
			{
				window.location.href="<%=path %>/chanpinpingjiaDel.action?id="+id;
			}
		}
		//修改信息
		function chanpinpingjiaGet(id)
		{
			window.location.href="chanpinpingjiaGet.action?id="+id;
		}
		//图片预览
		function over(picPath)
		{
			if (picPath=="")picPath="/images/default.jpg";
			x = event.clientX;
			y = event.clientY;
			document.all.tip.style.display = "block";
			document.all.tip.style.top = y;
			document.all.tip.style.left = x+10;
			document.all.photo.src = ".."+picPath;
		}
		function out()
		{
			document.all.tip.style.display = "none";
		}
		function down1(fujianPath,fujianYuashiMing)
		{
			var url="<%=path %>/updown/updown.jsp?fujianPath="+fujianPath+"&fujianYuashiMing="+fujianYuashiMing;
			url=encodeURI(url);
			url=encodeURI(url);
			window.open(url,"_self");
		}
		function go(index)
		{
			document.form123.index.value=index;
			document.form123.action="chanpinpingjiaManaMyQian.action"
			document.form123.submit();
		}
		function chanpinpingjiaAll(id,property,value)
		{
			if(confirm('您确定操作吗?'))
			{
				var form = document.getElementById("formset");
				form.getElementsByTagName("INPUT")[0].name = property;
				form.getElementsByTagName("INPUT")[0].value = value;
				document.formset.action="chanpinpingjiaSet.action?id="+id
				document.formset.submit();
				//window.location.href="<%=path %>/chanpinpingjiaSet.action?id="+id+"&isurl=1"+"&"+property+"="+value;
			}
		}

		function typechange()
		{
			//alert("typechange start");
			//document.formAdd.typename.value=document.formAdd.type.text;
			var obj = document.getElementById("type"); //定位id				//document.getElementById(id)
			var index = obj.selectedIndex; // 选中索引
			var text = obj.options[index].text; // 选中索引值
			//alert(index);
			//alert(text);
			//var text = obj.options[index].text; // 选中文本     输出张三等汉字信�?
			//var value = obj.options[index].value; // 选中     输出zhangsan等英文信�?
			//obj.options[index].text = obj.options[index].value;
			document.getElementById("typename").value = text; //okok
			//document.formAdd.typename.value=text; //error
			//alert("typechange end");
		}
		function init()
		{

				           shangpinSelect();
	           usersSelect();

			/*leibieSelect();*/

			
			/*typechange();*/
		}

			        function shangpinSelect()
	        {
	            loginService.shangpinSelect(shangpincallBack);
	        }
	        function shangpincallBack(data)
	        {
	            DWRUtil.addOptions("shangpinid",data,"id","mingcheng");
	        }
	        function usersSelect()
	        {
	            loginService.usersSelect(userscallBack);
	        }
	        function userscallBack(data)
	        {
	            DWRUtil.addOptions("usersid",data,"id","loginname");
	        }


		//子表管理示例代码
		/*			function tupianGetByxinwen_id(xinwen_id)
                    {
                        var url="<%=path %>/tupianGetByxinwen_id.action?xinwen_id="+xinwen_id;
				window.location.href=url;
			}*/
		/*classNameLowerAll.jsp.SontableNameLowerGetbyFatheridjsList*/

        function dingdanAddQian()
        {
            <c:if test="${requestScope.jine==0}">
            alert("请先添加购物车！");
            return;
            </c:if>

            var url = "<%=path %>/dingdanAddQian.jsp?jine=${requestScope.jine}";
            window.location.href = url;

        }
	</script>
</head>

<body onload="init()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="1000" height="1160" border="0" align="center"
       cellpadding="0" cellspacing="0" id="__01">
    <tr>
        <td>
            <%@ include file="qttop.jsp" %>
        </td>
    </tr>

    <tr>
        <td>
            <table id="__01" width="1000" height="804" border="0"
                   cellpadding="0" cellspacing="0">
                <tr>
                    <td valign="top">
                        <%@ include file="qtleft.jsp" %>
                    </td>
                    <td valign="top">
                        <table id="__01" width="770" height="804"
                               border="0" cellpadding="0" cellspacing="0">

                            <%----%>
                            <%@ include file="bht.jsp" %>
                            <%----%>

                            <tr>
                                <td valign="top">
                                    <table id="__01" width="770" height="276"
                                           border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td width="770" height="36"
                                                background="qtimages/1_02_02_01_01.gif">
                                                <table
                                                        width="98%" height="22" border="0" cellpadding="0"
                                                        cellspacing="0">
                                                    <tr>
                                                        <td width="17%" align="center"><strong>评论</strong>
                                                        </td>
                                                        <td width="83%">&nbsp;</td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table id="__01" width="770" height="231"
                                                       border="0" cellpadding="0" cellspacing="0">
                                                    <tr>
                                                        <td width="11" background="qtimages/1_02_02_01_02_01.gif">
                                                            &nbsp;
                                                        </td>
                                                        <td height="759" valign="top">

                                                            <%--<form name="form1" id="form1" method="post" action="<%=path %>/chanpinpingjiaSearchQian.action">

																            评语:
            <input type="text" name="biaoti" id="biaoti" style='border:solid 1px #000000; color:#666666' size="12" />
            分数（范围1-5）:
            <input type="text" name="fenshu" id="fenshu" style='border:solid 1px #000000; color:#666666' size="12" />
                                评论菜品:
                                <select name="shangpinid" id="shangpinid" style='border:solid 1px #000000; color:#666666;'>
                                    <option value="">全部</option>
                                </select>
								评论用户:
								<select name="usersid" id="usersid" >
									<option value="">全部</option>
								</select>


																<input type="submit" name="Submit" value="查找" style='border:solid 1px #000000; color:#666666'/>
                                                            </form>--%>
                                                            <table width="100%" border="0" align="center"
                                                                   cellpadding="3" cellspacing="1" bordercolor="00FFFF"
                                                                   style="border-collapse:collapse" class="newsline">

																<tr>
																	<td width="30" align="center" bgcolor="">序号</td>

																	<%--colunmRemarks--%>
																					    <td bgcolor='' align="center" >评语</td>
				    <td bgcolor='' align="center" >分数（范围1-5）</td>
				    <td bgcolor='' align="center" >时间</td>
				    <td bgcolor='' align="center" >评论菜品</td>
				    <td bgcolor='' align="center" >评论用户</td>



																	<td width="30" align="center" bgcolor="">详细</td>
																</tr>

																<c:forEach items="${requestScope.page.data}" var="chanpinpingjia" varStatus="s">

																	<tr>
																		<td width="30" align="center">
																				${s.index+1}
																		</td>

																			<%--colunmNameValue--%>
																							<td bgcolor="" align="center">
						<c:if test="${fn:length(chanpinpingjia.biaoti)>'16'}">
							${fn:substring(chanpinpingjia.biaoti,0,16)}...
						</c:if>
						<c:if test="${fn:length(chanpinpingjia.biaoti)<='16'}">
							${chanpinpingjia.biaoti}
						</c:if>
					</td>
					
					<td bgcolor="" align="center">
						<c:if test="${fn:length(chanpinpingjia.fenshu)>'16'}">
							${fn:substring(chanpinpingjia.fenshu,0,16)}...
						</c:if>
						<c:if test="${fn:length(chanpinpingjia.fenshu)<='16'}">
							${chanpinpingjia.fenshu}
						</c:if>
					</td>
					
					<td bgcolor="" align="center">
						<c:if test="${fn:length(chanpinpingjia.shijian)>'16'}">
							${fn:substring(chanpinpingjia.shijian,0,16)}...
						</c:if>
						<c:if test="${fn:length(chanpinpingjia.shijian)<='16'}">
							${chanpinpingjia.shijian}
						</c:if>
					</td>
					
					<td bgcolor="" align="center">
						<c:if test="${fn:length(chanpinpingjia.shangpin.mingcheng)>'16'}">
							${fn:substring(chanpinpingjia.shangpin.mingcheng,0,16)}...
						</c:if>
						<c:if test="${fn:length(chanpinpingjia.shangpin.mingcheng)<='16'}">
							${chanpinpingjia.shangpin.mingcheng}
						</c:if>
					</td>
					<td bgcolor="" align="center">
						<c:if test="${fn:length(chanpinpingjia.users.loginname)>'16'}">
							${fn:substring(chanpinpingjia.users.loginname,0,16)}...
						</c:if>
						<c:if test="${fn:length(chanpinpingjia.users.loginname)<='16'}">
							${chanpinpingjia.users.loginname}
						</c:if>
					</td>



																		<td width="30" align="center">
                                                                            <a href="<%=path %>/chanpinpingjiaDetailQian.action?id=${chanpinpingjia.id}">
                                                                                详细
                                                                            </a>
                                                                            <a href="<%=path %>/chanpinpingjiaDel.action?id=${chanpinpingjia.id}&path=gouwucheManaMyQian.action">
                                                                                删除
                                                                            </a>
																		</td>
																	</tr>
																</c:forEach>

                                                            </table>
                                                            <br> <!--yoxugonxgzitoxnxgjxi--> <!--youzuiping3-->
															<%@ include file="/hsgfenye.jsp"%>
															<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bordercolor="#00FFFF"
																   style="border-collapse:collapse" class="newsline">
																<tr>
																	<td align="center" bgcolor="">
                                                                        总金额：${requestScope.jine}
                                                                        <input type="button" value="提交订单" style="width: 100px;"
                                                                               onClick="dingdanAddQian();" />
																		<%--
                                                                        <input type="button" value="添加" style="width: 120px;" onclick="chanpinpingjiaAddQian()" />
                                                                        --%>
																		<input type="button" value="打印" style="width: 60px;" onClick="javascript:window.print()" />
																		<input type="button" value="返回" style="width: 60px;" onClick="javascript:history.back()" />

																	</td>

																</tr>
															</table>
														</td>
                                                        <td width="10" background="qtimages/1_02_02_01_02_04.gif">
                                                            &nbsp;
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><img src="qtimages/1_02_02_01_03.gif" width="770"
                                                     height="9" alt="">
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>

                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td>
            <%@ include file="qtdown.jsp" %>
        </td>
    </tr>
</table>
<!-- dfexnxxiaxng -->
</body>
</html>
<!--suxilxatxihuxan-->
